// import type { Reducer, Effect } from 'umi';

import { Effect, Reducer } from "umi";

export type StateType = {
	data: {},
	title: string,
};

export type ModelType = {
	namespace: 'index';
	state: StateType;
	reducers: {
		updateState: Reducer<StateType>;
	};
	effects: {
		getInfo: Effect,
	};
	
};


const Model: ModelType = {
	namespace: 'index',
	state: {
		data: {},
		title: '子组件',
	},
	reducers: {
		updateState(state, { payload }) {
			return {...state, ...payload};
		}
	},
	effects: {
    * getInfo({payload}, {call, put}) {
			// const res = yield call('xxx', payload)
			// if (res && res.code == 0) {
			// 	yield put({
			// 		type: 'updateState',
			// 		payload: {
			// 			recommendApps: res.data
			// 		}
			// 	})
			// }
		}
	}
};

export default Model;